package com.juanpi.order.configuration.controller;

import com.juanpi.order.configuration.bean.KafkaConfigBean;
import com.juanpi.order.configuration.bean.Page;
import com.juanpi.order.configuration.bean.UserConfig;
import com.juanpi.order.configuration.dao.UserConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author xueqing
 *         Created on 2017/2/27.
 */

@Controller
public class UserConfigController {

    @Autowired
    private UserConfigMapper userConfigMapper;

    @RequestMapping(value = "/userConfig/insert", method = RequestMethod.POST)
    @ResponseBody
    public UserConfig insert(UserConfig kafkaConfigBean){
        userConfigMapper.saveUserConfig(kafkaConfigBean);
        return kafkaConfigBean;
    }

    @RequestMapping(value = "/userConfig/update", method = RequestMethod.POST)
    @ResponseBody
    public UserConfig update(UserConfig kafkaConfigBean){
        userConfigMapper.updateUserConfig(kafkaConfigBean);
        return kafkaConfigBean;
    }

    public Page<UserConfig> findPage(){
        return null;
    }
}
